import openpyxl

class ExcelUtils:
    @staticmethod
    def read_excel(file_path, sheet_name):
        wb = openpyxl.load_workbook(file_path)
        sheet = wb[sheet_name]
        data = []
        # 跳过表头，从第二行开始读取
        for row in range(2, sheet.max_row + 1):
            case_data = {
                "case_id": sheet.cell(row, 1).value,
                "username": sheet.cell(row, 2).value,
                "password": sheet.cell(row, 3).value,
                "expected": sheet.cell(row, 4).value
            }
            data.append(case_data)
        return data